character_to_ascii
This function returns the ASCII code of a character.
int character_to_ascii(string the_character)
Parameters:
the_character
The character that will be converted.
Return value:
An integer containing the given character's ASCII code, or -1 on error.
Remarks:
If an empty string is passed, the function will return -1.
This function supports all ASCII values from 0 to 255, which includes the extended character set. This means that foreign characters and currency symbols can also be converted.
If more than one character is entered into the string parameter, the function converts the first character and ignores the rest.
Example:
void main()
{
alert("character_to_ascii test", character_to_ascii("A")); // Output should be 65
}